<% my_module ||= @my_module %>
<% element_id ||= nil %>
<% repository ||= nil %>
<% repository_snapshot ||= nil %>
<% repository = assigned_repository_or_snapshot(my_module, element_id, repository, repository_snapshot) %>
<% order ||= @order %>
<% timestamp = Time.current + 1.year - 1.days %>
<% rows_json = my_module.repository_json_hot(repository, order) %>
<div class="report-element report-module-repository-element"
     data-sort-hot="1"
     data-ts="<%= timestamp.to_i %>"
     data-type="my_module_repository"
     data-id='{ "my_module_id": <%= my_module.id %>, "repository_id": <%= repository.id %> }'
     data-scroll-id="<%= "#{my_module.id}_#{repository.id}" %>"
     data-order="<%= order == :asc ? 'asc' : 'desc' %>"
     data-name="<%= repository.name %>"
     data-icon-class="fas fa-list-alt">
  <div class="report-element-header">
    <div class="row">
      <div class="pull-left repository-icon">
        <i class="fas fa-list-alt"></i>
      </div>
      <div class="pull-left repository-name">
        <%= t('projects.reports.elements.module_repository.name', repository: repository.name, my_module: my_module.name) %>
        <i><%= t('projects.reports.index.deleted') if repository.is_a?(RepositorySnapshot) && !repository.original_repository %></i>
      </div>
      <% if defined?(export_all) && export_all %>
        <div class="pull-left table-name">
            <a href="<%= path[:file] %>">
              <em><%= t('projects.reports.elements.module_repository.table_name', name: filename) %></em>
            </a>
        </div>
      <% end %>
      <div class="pull-right controls">
        <%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true } %>
      </div>
    </div>
  </div>
  <div class="report-element-body">
    <% if rows_json[:data].count > 0 %>
    <input type="hidden" class="hot-table-contents hot-repository-items" value='<%= rows_json.to_json.force_encoding(Encoding::UTF_8) %>' />
    <div class="hot-table-container"></div>
    <table class="report-common-table-format"></table>
    <% else %>
      <div class="row">
        <div class="col-xs-12">
          <em><%= t('projects.reports.elements.module_repository.no_items') %></em>
        </div>
      </div>
    <% end %>
  </div>
  <div class="report-element-children">
    <%= children if defined?(children) && children.present? %>
  </div>
</div>
